/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufba.lasid.v1.jitclouds.mda.datatypes.ft;

import br.ufba.lasid.v1.jitclouds.mda.datatypes.IConfiguration;
import br.ufba.lasid.v1.jitclouds.mda.datatypes.virtualization.IHypervisor;
import br.ufba.lasid.v1.jitclouds.mda.datatypes.virtualization.IVirtualMachine;

/**
 *
 * @author aliriosa
 */
public class BasicReplicableVirtualMachine implements IReplicableVirtualMachine{

    private IVirtualMachine machine = null;
    private boolean updated = false;
    private IReplicableList view = null;
    
    @Override
    public IConfiguration getConfiguration() {
        return this.machine.getConfiguration();
    }

    @Override
    public void setConfiguration(IConfiguration config) {
        this.machine.setConfiguration(config);
    }

    @Override
    public IHypervisor getHypervisor() {
        return this.machine.getHypervisor();
    }

    @Override
    public void setHypervisor(IHypervisor hypervisor) {
        this.machine.setHypervisor(hypervisor);
    }

    @Override
    public void execute(String command) {
        this.machine.execute(command);
    }

    @Override
    public void shutdown() {
        this.machine.shutdown();
    }

    @Override
    public void startup() {
        this.machine.startup();
    }

    @Override
    public void reboot() {
        this.machine.reboot();
    }

    @Override
    public void pause() {
        this.machine.pause();
    }

    @Override
    public boolean isUpdated() {
        return this.updated;
    }

    @Override
    public IReplicableList getView() {
        return this.view;
    }

    @Override
    public void setID(String ID) {
        machine.setID(ID);
    }

    @Override
    public String getID() {
        return machine.getID();
    }

    @Override
    public void setDescription(String description) {
        this.machine.setDescription(description);
    }

    @Override
    public String getDescription() {
        return this.machine.getDescription();
    }

    @Override
    public void setUpdated(boolean updated) {
        this.updated = updated;
    }

    @Override
    public void setInitialView(IReplicableList initialView) {
        this.view = initialView;
    }

    @Override
    public IVirtualMachine getBaseVirtualMachine() {
        return this.machine;
    }

    @Override
    public void setBaseVirtualMachine(IVirtualMachine base) {
        this.machine = base;
    }
    
    public static IReplicableVirtualMachine vm2rvm(IVirtualMachine base){
        BasicReplicableVirtualMachine rvm = new BasicReplicableVirtualMachine();
        rvm.setBaseVirtualMachine(base);        
        return rvm;
    }

    private VMStatus status;
    
    @Override
    public void setStatus(VMStatus status) {
        this.status = status;
    }

    @Override
    public VMStatus getStatus() {
        return this.status;
    }

    public void destroy() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
